#!/usr/bin/env python3

import rospy
from DrEmpower_can.msg import impedance_control
# import DrEmpower as dr

def callback(data):
    import DrEmpower as dr
    dr.impedance_control(id_num=data.id_num, angle=data.angle, speed=data.speed, tff=data.tff, kp=data.kp, kd=data.kd,mode=data.mode)
    rospy.loginfo("impedance_control_node")


def listener():
    rospy.init_node("impedance_control", anonymous=True)
    rospy.Subscriber("impedance_control", impedance_control, callback)
    rospy.spin()


if __name__ == '__main__':
    listener()

